﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WindowsFormsApplication2.Model;

namespace WindowsFormsApplication2
{
    public partial class inputCabang : Form
    {
        public inputCabang()
        {
            InitializeComponent();
        }

        private void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                Cabang c = new Cabang();
                c.addCabang(txtNama.Text, rtbAlamat.Text, ((cmbGender.SelectedIndex == 0) ? true : false));
                c = new Cabang(txtNama.Text);
            }

            catch (Exception msg)
            {
                // throw error message
                MessageBox.Show(msg.ToString());
                throw;
            }
        }
    }
}
